package com.tao.pojo.vo;

import com.tao.pojo.entity.ProductFlavor;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductVo implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;

    private String name;

    private BigDecimal price;

    private Integer stock;

    private String image;

    private String description;

    private Integer status; // 建议使用枚举类型以增加代码可读性



    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


    //这里与实体类型不同，故用Vo返回数据
    private String categoryName;
    private List<ProductFlavor> productFlavors = new ArrayList<>();
}
